package com.omybug.springboot.redis.distributedlocker;

import org.redisson.api.RLock;

import java.util.concurrent.TimeUnit;

/**
 * @author oMyBug
 * @since 2019/6/11 14:23
 */
public interface DistributedLocker {

    RLock lock(String lockKey);

    RLock lock(String lockKey, long leaseTime);

    RLock lock(String lockKey, long leaseTime, TimeUnit unit);

    boolean tryLock(String lockKey, long waitTime, long leaseTime, TimeUnit unit);

    void unlock(String lockKey);

    void unlock(RLock lock);
}
